﻿@using SDE_FIC;
@model SDE_FIC.Models.Diario


@{
    ViewBag.Title = "Diário de Turma";
    Layout = "~/Views/Shared/_Layout_Sistema.cshtml";
    var x = 0;
}
<h2>@ViewBag.Title</h2>

@using (Html.BeginForm())
{
    <div style="width: 400px; float: left;">
        @Html.LabelFor(model => Model.Data)
        @Html.EditorFor(model => Model.Data)
        <br />
        Unidade Curricular
        <br />
        @Html.DropDownListFor(model => Model.UnidadeCurricular.IdUnidadeCurricular, new SelectList(Model.Turma.Curso.UnidadesCurriculares,
                                                                                                      "IdUnidadeCurricular",
                                                                                                      "Descricao")
                              )

        @Html.LabelFor(model => Model.Conteudo)
        @Html.TextAreaFor(model => Model.Conteudo, new { @cols = "100", @rows = "3" })

        @Html.LabelFor(model => Model.Ocorrencia)
        @Html.TextAreaFor(model => Model.Ocorrencia, new { @cols = "80", @rows = "4" })
    </div>
    <div style="width: 400px; float: left;">
        Frequência:
        <table class="table table-bordered table-hover">
            <thead>
                <tr>
                    <th>Aluno
                    </th>
                    <th>Presença
                    </th>
                </tr>
            </thead>
            @for (var i = 0; i < Model.Frequencias.Count; i++)
            {
                <tbody>
                    <tr>
                        <td>@Model.Frequencias[i].Matricula.Aluno.Nome</td>
                        <td>@Html.EditorFor(m => Model.Frequencias[i].Presenca, new { style = "width: 10px;" })
                        </td>
                    </tr>
                </tbody>
            }
        </table>
    </div> 
    <div style="clear: both;"></div>
    <div style="width: 100%;"><button class="btn btn-large btn-primary" type="submit">Salvar</button></div>
}

